package iqq;

import iqq.common.IQQConstants;
import iqq.ui.view.ViewFactory;
import iqq.ui.view.frame.IQQFrame;
import iqq.util.SettingUtils;
import iqq.util.SystemUtils;

import javax.swing.JFrame;

/**
 * @author ChenZhiHui
 * @create-time 2013-3-8
 */
public class WindowStarter {
	public static void starter() {
		final IQQFrame iQQFrame = ViewFactory.getIQQFrame();
		iQQFrame.setIconImage(SettingUtils.getAppLogo());
		iQQFrame.setTitle(SettingUtils.getAppTitle());
		iQQFrame.setSize(IQQConstants.APP_DEF_WIDTH,
				IQQConstants.APP_DEF_HEIGHT);
		iQQFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		iQQFrame.setLocationRelativeTo(null);
		
		/**
		 * 解决LINUX兼容问题
		 */
		if (SystemUtils.isLinux()) {
			iQQFrame.setUndecorated(true);
			iQQFrame.setSize(IQQConstants.APP_DEF_WIDTH - 40,
					IQQConstants.APP_DEF_HEIGHT);
		}
		iQQFrame.setVisible(true);
	}
}
